package com.knight.controller;


import com.knight.annotation.KnightLog;
import com.knight.model.LoginVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {




    @KnightLog(desc = "登录")
    @PostMapping(value = "login")
    public String login(@RequestBody LoginVO loginVO) {

        return "success";
    }


    @KnightLog(desc = "登录2")
    @PostMapping(value = "login2")
    public String login2(@RequestBody LoginVO loginVO) {
        if(true) {
            throw new RuntimeException("密码错误");
        }
        return "success";
    }
}
